﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace T1linzhengsong
{
    class Program
    {
        static void Main(string[] args)
        {
            //初始化3个游戏
            //①
            Game sv = new Game();
            sv.name ="游戏1";
            sv.category = "休闲益智手机游戏";
            sv.price = 30;
            sv.stock = 100;
            sv.addtime = DateTime.Now;//添加日期为今天
            //②
            Game hv = new Game();
            hv.name = "游戏2";
            hv.category = "冒险解谜手机游戏";
            hv.price = 15;
            hv.stock = 100;
            hv.addtime = DateTime.Now; //添加日期为今天
            //③
            Game wv = new Game();
            wv.name = "游戏3";
            wv.category = "射击大战手机游戏";
            wv.price = 9;
            wv.stock = 100;
            wv.addtime = DateTime.Now; //添加日期为今天
            //定义数组
            Game[] games = new Game[3];
            games[0] = sv;
            games[1] = hv;
            games[2] = wv;
            //打印
            Console.WriteLine("序号\t游戏名称\t\t游戏类型\t\t游戏价格\t库存数量");
            for (int i = 0; i < games.Length; i++)
            {
                Console.WriteLine(i+"\t《"+games[i].name+"》\t\t"
                    +games[i].category+"\t"
                    + games[i].price + "\t\t"
                    + games[i].stock + "\t\t"
                    );
            }
            Console.WriteLine("============游戏入库============");
            games[0].Shang(8);
            games[1].Shang(8);
            games[2].Shang(8);
            Console.WriteLine("============游戏销售============");
            games[0].Shan(6);
            games[1].Shan(6);
            games[2].Shan(6);
        }
    }
}
